Optimal. Leaf size=192 \[ \frac {23 A \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{8 \sqrt {a} d}-\frac {2 \sqrt {2} A \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {9 A \sin (c+d x)}{8 d \sqrt {a-a \sec (c+d x)}}+\frac {7 A \cos (c+d x) \sin (c+d x)}{12 d \sqrt {a-a \sec (c+d x)}}+\frac {A \cos ^2(c+d x) \sin (c+d x)}{3 d \sqrt {a-a \sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.35, antiderivative size = 192, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 5, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.147, Rules used = {4107, 4005,
3859, 209, 3880} \begin {gather*} \frac {23 A \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{8 \sqrt {a} d}-\frac {2 \sqrt {2} A \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {9 A \sin (c+d x)}{8 d \sqrt {a-a \sec (c+d x)}}+\frac {A \sin (c+d x) \cos ^2(c+d x)}{3 d \sqrt {a-a \sec (c+d x)}}+\frac {7 A \sin (c+d x) \cos (c+d x)}{12 d \sqrt {a-a \sec (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 3859
Rule 3880
Rule 4005
Rule 4107
Rubi steps
\begin {align*} \int \frac {\cos ^3(c+d x) (A+A \sec (c+d x))}{\sqrt {a-a \sec (c+d x)}} \, dx &=\frac {A \cos ^2(c+d x) \sin (c+d x)}{3 d \sqrt {a-a \sec (c+d x)}}-\frac {\int \frac {\cos ^2(c+d x) \left (-\frac {7 a A}{2}-\frac {5}{2} a A \sec (c+d x)\right )}{\sqrt {a-a \sec (c+d x)}} \, dx}{3 a}\\ &=\frac {7 A \cos (c+d x) \sin (c+d x)}{12 d \sqrt {a-a \sec (c+d x)}}+\frac {A \cos ^2(c+d x) \sin (c+d x)}{3 d \sqrt {a-a \sec (c+d x)}}+\frac {\int \frac {\cos (c+d x) \left (\frac {27 a^2 A}{4}+\frac {21}{4} a^2 A \sec (c+d x)\right )}{\sqrt {a-a \sec (c+d x)}} \, dx}{6 a^2}\\ &=\frac {9 A \sin (c+d x)}{8 d \sqrt {a-a \sec (c+d x)}}+\frac {7 A \cos (c+d x) \sin (c+d x)}{12 d \sqrt {a-a \sec (c+d x)}}+\frac {A \cos ^2(c+d x) \sin (c+d x)}{3 d \sqrt {a-a \sec (c+d x)}}-\frac {\int \frac {-\frac {69 a^3 A}{8}-\frac {27}{8} a^3 A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx}{6 a^3}\\ &=\frac {9 A \sin (c+d x)}{8 d \sqrt {a-a \sec (c+d x)}}+\frac {7 A \cos (c+d x) \sin (c+d x)}{12 d \sqrt {a-a \sec (c+d x)}}+\frac {A \cos ^2(c+d x) \sin (c+d x)}{3 d \sqrt {a-a \sec (c+d x)}}+(2 A) \int \frac {\sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx+\frac {(23 A) \int \sqrt {a-a \sec (c+d x)} \, dx}{16 a}\\ &=\frac {9 A \sin (c+d x)}{8 d \sqrt {a-a \sec (c+d x)}}+\frac {7 A \cos (c+d x) \sin (c+d x)}{12 d \sqrt {a-a \sec (c+d x)}}+\frac {A \cos ^2(c+d x) \sin (c+d x)}{3 d \sqrt {a-a \sec (c+d x)}}+\frac {(23 A) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,\frac {a \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{8 d}-\frac {(4 A) \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,\frac {a \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{d}\\ &=\frac {23 A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{8 \sqrt {a} d}-\frac {2 \sqrt {2} A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {a} d}+\frac {9 A \sin (c+d x)}{8 d \sqrt {a-a \sec (c+d x)}}+\frac {7 A \cos (c+d x) \sin (c+d x)}{12 d \sqrt {a-a \sec (c+d x)}}+\frac {A \cos ^2(c+d x) \sin (c+d x)}{3 d \sqrt {a-a \sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 2.45, size = 362, normalized size = 1.89 \begin {gather*} \frac {A e^{-i (c+d x)} \left (47+40 e^{-i (c+d x)}+47 e^{i (c+d x)}+9 e^{-2 i (c+d x)}+40 e^{2 i (c+d x)}+2 e^{-3 i (c+d x)}+9 e^{3 i (c+d x)}+2 e^{4 i (c+d x)}-69 i d \sqrt {1+e^{2 i (c+d x)}} x+69 \sqrt {1+e^{2 i (c+d x)}} \sinh ^{-1}\left (e^{i (c+d x)}\right )+96 \sqrt {2} \sqrt {1+e^{2 i (c+d x)}} \log \left (1-e^{i (c+d x)}\right )+69 \sqrt {1+e^{2 i (c+d x)}} \log \left (1+\sqrt {1+e^{2 i (c+d x)}}\right )-96 \sqrt {2} \sqrt {1+e^{2 i (c+d x)}} \log \left (1+e^{i (c+d x)}+\sqrt {2} \sqrt {1+e^{2 i (c+d x)}}\right )\right ) \sec (c+d x) \left (\cos \left (\frac {1}{2} (c+d x)\right )+i \sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin \left (\frac {1}{2} (c+d x)\right )}{48 d \sqrt {a-a \sec (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(624\) vs.
\(2(163)=326\).
time = 8.97, size = 625, normalized size = 3.26
method | result | size |
default | \(-\frac {A \left (-1+\cos \left (d x +c \right )\right )^{3} \left (96 \sqrt {2}\, \left (\cos ^{2}\left (d x +c \right )\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {5}{2}}+40 \sqrt {2}\, \left (\cos ^{5}\left (d x +c \right )\right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}+192 \sqrt {2}\, \cos \left (d x +c \right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {5}{2}}+190 \sqrt {2}\, \left (\cos ^{4}\left (d x +c \right )\right ) \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}-160 \sqrt {2}\, \left (\cos ^{2}\left (d x +c \right )\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}}+96 \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {5}{2}}+465 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}\, \left (\cos ^{3}\left (d x +c \right )\right )-320 \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sqrt {2}\, \cos \left (d x +c \right )+480 \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right ) \sqrt {2}\, \left (\cos ^{2}\left (d x +c \right )\right )-49 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}\, \left (\cos ^{2}\left (d x +c \right )\right )-160 \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sqrt {2}+960 \sqrt {2}\, \cos \left (d x +c \right ) \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right )+690 \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right ) \left (\cos ^{2}\left (d x +c \right )\right )+155 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}\, \cos \left (d x +c \right )+480 \sqrt {2}\, \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right )+1380 \cos \left (d x +c \right ) \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right )+135 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}+690 \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right )\right ) \sqrt {2}}{240 d \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {\frac {a \left (-1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}}\, \sin \left (d x +c \right )^{5}}\) | \(625\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.72, size = 484, normalized size = 2.52 \begin {gather*} \left [\frac {48 \, \sqrt {2} A a \sqrt {-\frac {1}{a}} \log \left (-\frac {2 \, \sqrt {2} {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \sqrt {-\frac {1}{a}} - {\left (3 \, \cos \left (d x + c\right ) + 1\right )} \sin \left (d x + c\right )}{{\left (\cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - 69 \, A \sqrt {-a} \log \left (\frac {2 \, {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} - {\left (2 \, a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right )}{\sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - 2 \, {\left (8 \, A \cos \left (d x + c\right )^{4} + 22 \, A \cos \left (d x + c\right )^{3} + 41 \, A \cos \left (d x + c\right )^{2} + 27 \, A \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}}}{48 \, a d \sin \left (d x + c\right )}, \frac {48 \, \sqrt {2} A \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - 69 \, A \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - {\left (8 \, A \cos \left (d x + c\right )^{4} + 22 \, A \cos \left (d x + c\right )^{3} + 41 \, A \cos \left (d x + c\right )^{2} + 27 \, A \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}}}{24 \, a d \sin \left (d x + c\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} A \left (\int \frac {\cos ^{3}{\left (c + d x \right )}}{\sqrt {- a \sec {\left (c + d x \right )} + a}}\, dx + \int \frac {\cos ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{\sqrt {- a \sec {\left (c + d x \right )} + a}}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.06, size = 166, normalized size = 0.86 \begin {gather*} \frac {\frac {48 \, \sqrt {2} A \arctan \left (\frac {\sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{\sqrt {a}}\right )}{\sqrt {a}} - \frac {69 \, A \arctan \left (\frac {\sqrt {2} \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{2 \, \sqrt {a}}\right )}{\sqrt {a}} - \frac {\sqrt {2} {\left (21 \, {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )}^{\frac {5}{2}} A + 80 \, {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )}^{\frac {3}{2}} A a + 108 \, \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a} A a^{2}\right )}}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a\right )}^{3}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^3\,\left (A+\frac {A}{\cos \left (c+d\,x\right )}\right )}{\sqrt {a-\frac {a}{\cos \left (c+d\,x\right )}}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________